<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增检测机构基本')" />
	<th:block th:include="include :: datetimepicker-css" />
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: datetimepicker-js" />
	<link th:href="@{/css/city-picker.css}" rel="stylesheet"  />
	<script th:src="@{/js/city-picker.data.js}"></script>
	<script th:src="@{/js/city-picker.js}"></script>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-tJcJcjg-add">
				<div class="row">
					<div class="col-sm-12">
						<div class="form-group">
							<label class="col-sm-2 control-label"><span
									style="color: red; ">*</span>统一社会信用代码：</label>
							<div class="col-sm-10">
								<input id="code" name="code" class="form-control" type="text" required>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-sm-12">
						<div class="form-group">
							<label class="col-sm-2 control-label"><span
									style="color: red; ">*</span>检测机构名称：</label>
							<div class="col-sm-10">
								<input id="agencyName" name="agencyName" class="form-control" type="text" required>
							</div>
						</div>
					</div>
				</div>
			<div class="row">
				<div class="col-sm-12">
					<div class="form-group">
						<label class="col-sm-2 control-label"><span
								style="color: red; ">*</span>单位地址：</label>
						<div class="col-sm-10">
							<input id="address" name="address" class="form-control"
								   type="text" required>
						</div>
					</div>
				</div>
			</div>

			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">法人代表：</label>
						<div class="col-sm-8">
							<input id="legalRepresentative" name="legalRepresentative" class="form-control" type="text">
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">证件号码：</label>
						<div class="col-sm-8">
							<input id="idCard" name="idCard" class="form-control" type="text" >
						</div>
					</div>
				</div>
			</div>



			<div class="row">

				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">所属行政区：</label>
						<div class="col-sm-8">
							<input name="district" id="district" class="form-control" readonly type="text"  data-toggle="city-picker">
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">邮政编码：</label>
						<div class="col-sm-8">
							<input id="emailCode" name="emailCode" class="form-control" type="text">
						</div>
					</div>
				</div>

			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">经济性质：</label>
						<div class="col-sm-8">
							<input id="economicNature" name="economicNature" class="form-control" type="text">
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">成立日期：</label>
						<div class="col-sm-8">
							<input id="date" name="date" class="form-control" type="text" placeholder="成立日期">
						</div>
					</div>
				</div>
			</div>
			<div class="row">

				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">联系人：</label>
						<div class="col-sm-8">
							<input id="tellMan" name="tellMan" class="form-control" type="text">
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">联系电话：</label>
						<div class="col-sm-8">
							<input id="tellPhone" name="tellPhone" class="form-control" type="text">
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">联系人职务：</label>
						<div class="col-sm-8">
							<input id="tellPosition" name="tellPosition" class="form-control" type="text">
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">传真电话：</label>
						<div class="col-sm-8">
							<input id="fax" name="fax" class="form-control" type="text">
						</div>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">单位网址：</label>
						<div class="col-sm-8">
							<input id="organizationUrl" name="organizationUrl" class="form-control" type="text">
						</div>
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label class="col-sm-4 control-label">邮箱地址：</label>
						<div class="col-sm-8">
							<input id="email" name="email" class="form-control" type="text">
						</div>
					</div>
				</div>
			</div>
			<div class="row">

				<div class="col-sm-12">
					<div class="form-group">
						<label class="col-sm-2 control-label">备注：</label>
						<div class="col-sm-10">
							<textarea id="remarks" name="remarks" class="form-control"
									  type="text"></textarea>
						</div>
					</div>
				</div>
			</div>

		</form>
	</div>
	<div class="row">
		<div class="col-sm-offset-5 col-sm-10">
			<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保存</button>&nbsp;
			<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
		</div>
	</div>
    <script type="text/javascript">
		var prefix = ctx + "system/tJcJcjg";
		$(function() {
			$("#date").datetimepicker({
				format: "yyyy-mm-dd",
				minView: "month",
				autoclose: true
			});
		});
		$("#form-tJcJcjg-add").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		function submitHandler() {
			if ($.validate.form()) {
				var data = $("#form-tJcJcjg-add").serializeArray();
				var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
				var roleIds = $.form.selectCheckeds("role");
				var postIds = $.form.selectSelects("post");
				data.push({"name": "status", "value": status});
				data.push({"name": "roleIds", "value": roleIds});
				data.push({"name": "postIds", "value": postIds});
				$.operate.saveTab(prefix + "/add", data);
			}
		}
		/*function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/add", $('#form-tJcJcjg-add').serialize());
	        }
	    }*/
	</script>
</body>
</html>
